const express = require("express");
const router = express.Router();
const expressJoi = require("@escook/express-joi")
const userHandler = require('../router_handler/login')
const { reg_login_schema, reg_register_schema, reg_verify_schema, reg_reset_schema, reg_sendCode_schema } = require("../schema/login")

router.post('/login', expressJoi(reg_login_schema), userHandler.login)
router.post('/register', expressJoi(reg_register_schema), userHandler.register)

router.post('/verify', expressJoi(reg_verify_schema), userHandler.verify)

router.post('/resetPassword', expressJoi(reg_reset_schema), userHandler.resetPassword)

router.get('/getCaptcha', userHandler.getCaptcha)

router.post('/sendCode', expressJoi(reg_sendCode_schema), userHandler.sendCode)
module.exports = router